package com.squapsource.project_euler;

import java.math.BigInteger;

public class Problem16 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		long sum = 0; 
		BigInteger pow = BigInteger.valueOf(2).pow(1000);
		for (Character num : pow.toString().toCharArray())
		{
			sum += Integer.parseInt(num.toString());
		}
		System.out.println(sum);

	}

}
